package com.digital.welcome.websocket.mywebsocket;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;

import org.apache.commons.lang3.tuple.Pair;

import com.digital.welcome.websocket.mywebsocket.model.WebSocketMessage;
import com.digital.welcome.websocket.mywebsocket.model.WebSocketMessageEvent;

import cn.hutool.core.lang.func.Func;


public interface IWebSocketMessageService {
    IWebSocketMessageService addEventHandler(
        WebSocketMessageEvent messageEvent, 
        Func<Pair<IWebSocketSession, ArrayList<WebSocketMessage>>, ArrayList<WebSocketMessage>> eventHandler);
        
    ArrayList<WebSocketMessage> onMessage(IWebSocketSession session, ArrayList<WebSocketMessage> messages) throws Exception;
}
